﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Reflection;

namespace GrainManage
{
    public class NotificationObject : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;

        public void RaisePropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        public static string GetPropertyName(MethodBase property)
        {
            string name = property.Name;
            if (name.StartsWith("set_") || name.StartsWith("get_"))
            {
                name = property.Name.Substring(4);
            }
            return name;
        }

    }
}
